import mutagen.mp3

baseUrl = "http://121.41.112.199:3000"


def checkLocalFile(song):
    # 优先使用本地数据
    try:
        audio = mutagen.mp3.MP3("C:/Users/TFC/Music/" + song.get("name") + "-" + song.get("artists")[0].get("name") + ".mp3")
        # 提取文件信息
        title = audio.get("TIT2")
        return title
    except mutagen.mp3.MutagenError:
        raise FileNotFoundError
